<template>
  <view class="package">
    <uni-card class="single" v-for="(item,index) in packageList" :key="index">
      <view class="name">{{item.packageName}}</view>
      <view>有效期：{{item.useBeginTime}} -- {{item.useEndTime}}</view>
    </uni-card>

    <view class="nodata" v-if="packageList.length == 0">
      <image class="empty_img" src="/static/empty.png" mode="widthFix"></image>
      <view>没有你想要的内容</view>
    </view>
  </view>
</template>

<script>
  import {
    chargePackage
  } from '@/api/equip.js';
  export default {
    data() {
      return {
        packageList: [],
      }
    },
    created() {
      this.getDataList();
    },
    methods: {
      getDataList() {
        chargePackage('/bought/list', 'get', {}).then(res => {
          this.packageList = res.data;
        }).catch(err => {

        })
      }
    }
  }
</script>

<style lang="scss" scoped>
  @import "@/static/css/common.scss";
  @import "@/static/css/main.scss";

  .package {
    margin: 0 3%;

    .single {
      font-size: 24rpx;
      
      .name {
        color: #000000;
        font-size: 36rpx;
        font-weight: bold;
        margin-bottom: 30rpx;
      }
    }
  }
  /deep/ .uni-card .uni-card__content{
    padding: 30rpx 10rpx !important;
  }
</style>
